package com.gome.axwl.aoc.facade.util;

import com.gome.axwl.aoc.common.util.ErrorCode;
import com.gome.axwl.aoc.entity.exception.ZQException;
import com.gome.axwl.aoc.entity.zq.ZQBaseResult;

/**
 * Created by wanglongyu on 2018/7/18.
 */
public class ZQCheckResponseUtil {
    /***
     * 验证众签返回
     * @param obj
     * @param <T>
     * @throws ZQException
     */
    public static <T extends ZQBaseResult> void validZQResponse(T obj) throws ZQException {
        if(obj == null){
            throw new ZQException(ErrorCode.REQUEST_ZQ_FAILD,ErrorCode.REQUEST_ZQ_FAILD_MSG);
        }
        if(!"0".equals(obj.getCode())){//调用众签出错
            throw new ZQException(obj.getCode(),obj.getMsg());
        }
    }
}
